package NinetyNine;

import java.io.Serializable;

/**
 *
 * @author JOKE
 * Player
 */
public class Player implements Serializable {
    int userid;
    String username;
    int userstatus;
    Deck hand;
    int wins;
    int plays;
    double ratio;

    public Player(int userid, String username, int userstatus, int plays,
            int wins, double ratio)
    {
        this.userid=userid;
        this.userstatus=userstatus;
        this.username=username;
        this.wins = wins;
        this.plays = plays;
        this.ratio = ratio;
        this.hand = new Deck();
    }

    public Player(int userid, String username) {
        this.userid = userid;
        this.username = username;
        this.userstatus = 0;
        this.wins = 0;
        this.plays = 0;
        this.ratio = 0;
        this.hand = null;
    }

    public int getPlays() {
        return plays;
    }

    public void played() {
        this.plays++;
    }

    public double getRatio() {
        return this.ratio;
    }

    public double calcRatio() {
        this.ratio = (double)this.wins/this.plays;
        return this.ratio;
    }

    public int getUserid() {
        return this.userid;
    }

    public String getUsername() {
        return this.username;
    }

    public int getUserstatus() {
        return this.userstatus;
    }

    public void setUserstatus(int userstatus) {
        this.userstatus = userstatus;
    }

    public int getWins() {
        return this.wins;
    }

    public void won() {
        this.wins++;
    }

    public Deck getHand() {
       return this.hand;
    }

}
